package com.qilu.pe.ui.activity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.qilu.pe.R;
import com.qilu.pe.base.Base2Activity;

// 支付成功
public class PaySuccessActivity extends Base2Activity {
    private TextView tv_ok;

    private String from;// 标识跳转来源

    @Override
    protected int getLayoutRes() {
        return R.layout.activity_pay_success;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        tv_ok = findViewById(R.id.tv_ok);

        setNoNavigationIcon();

        Bundle bundle = getIntent().getExtras();
        if (null != bundle) {
            from = bundle.getString("from");
        }

        setHeadTitle("支付成功");

        setListeners();
    }

    private void setListeners() {
        setOnClickListener(tv_ok);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        if (v == tv_ok) {// 确定
            if (TextUtils.equals("recharge", from)) {// 余额充值页面跳转过来的

            } else if (TextUtils.equals("expert", from)) {// 申请专家解读页面跳转过来的
                startActivity(ExpertExplainActivity.class);
            } else {// 预约订单
                startActivity(MyOrderActivity.class);
            }
            finish();
        }
    }
}